<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">




<title>多线程 - Autumoon - 博客园</title>
<meta name="keywords" content="白话C#系列,多线程">



<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/Autumoon/rss">
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/Autumoon/rsd.xml"> 
  



<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head>
<body>
    <form name="Form1" method="post" action="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html" id="Form1">
<div>
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>

        
<!--done-->
<div id="home">
<div id="header">
	<div id="blogTitle">
		
<!--done-->
<h1><a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/Autumoon/">Autumoon</a></h1>
<h2><a href="http://www.autumoon.com/" target="_top" title="欢迎访问Autumoon Lab！">www.Autumoon.com</a></h2>



		
	</div><!--end: blogTitle 博客的标题和副标题 -->
	<div id="navigator">
		
<!--done-->
			<ul id="navList">
				<li></li>
				<li></li>
				<li><a href="http://home.cnblogs.com/">主页</a></li>
				<li><a href="http://home.cnblogs.com/ing/">闪存</a></li>				
				<li></li>
				<li><a id="MyLinks1_ContactLink" accesskey="9" class="menu" href="http://space.cnblogs.com/msg/send/Autumoon">联系</a></li>
				<li><a id="MyLinks1_Admin" class="menu" href="http://www.cnblogs.com/Autumoon/admin/EditPosts.aspx">管理</a></li>
				<li><a id="MyLinks1_Syndication" class="menu" href="http://www.cnblogs.com/Autumoon/rss">订阅</a>
				<a id="MyLinks1_XMLLink" class="aHeaderXML" href="http://www.cnblogs.com/Autumoon/rss"><img src="rss.gif" alt="订阅" style="border-width: 0px;"></a></li>
			</ul>


		<div class="blogStats">
			
			
<!--done-->
随笔-71&nbsp;
文章-0&nbsp;
评论-326&nbsp;

			
		</div><!--end: blogStats -->
	</div><!--end: navigator 博客导航栏 -->
</div><!--end: header 头部 -->
<div id="main">
	<div id="mainContent">
	<div class="forFlow">
		
					
<!--done-->
<div id="topics">
	<div class="post">
		<h1 class="postTitle">
			<a id="ctl04_TitleUrl" class="postTitle2" href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html">多线程</a>
		</h1>
		<div class="clear"></div>
		<div class="postBody">
			<p><font size="2"><a href="http://www.cnblogs.com/Autumoon/archive/2008/04/16/1156864.html">【回目录】</a></font></p>
<p><font size="2">多线程是程序员面试时常常会面对的问题，对多线程概念的掌握和理解水平，也会被一些老鸟用来衡量一个人的编程实力的重要参考指标。不论是实际工作需要还是为了应付面试，掌握多线程都是程序员职业生涯中一个必须经过的环节。其实当你把“多线程”和你的“职业生涯”联系在一起考虑的时候，就会觉得“多线程”是多么的渺小，对，没有跨越不过的山。不过就算它很渺小，但也有可能改变你的人生轨迹。不用担心，如果你对多线程还不太熟悉，那么我们就一起来看看什么是多线程吧。</font></p>
<p><font size="2">跟前几篇的风格一样，我会在开篇的时候举一个现实生活中的例子，通过这个例子来映射一些晦涩枯燥的计算机编程专业知识，在让读者朋友很好地理解理论概念的同时，又避免了阅读教科书时的枯燥感觉。这次我要举的例子是公司。不一定是IT公司，尽量和编程领域远一点儿吧，那就假设是一家搬家公司吧。</font></p>
<p><font size="2">假如我们把公司看做是一个进程，那么人就是其中的线程。进程必须得有一个主线程，公司在创业初期往往可能出现一人打天下的现象，但是，至少得有一个人，公司才能运作。公司创业初期，业务还不算太多，往往就是老板一个人身兼数职，一天如果只有1、2趟活儿，应该还是忙得过来的。时间长了，随着业务的发展、口碑的建立，生意越来越兴隆，一个人肯定就忙不过来了。假设一天有5个活儿，老板一个人必须搬完A家才能搬B家，搬到黄昏估计也就搬到C家，D和E家都还在焦急地等待着呢。老板一个人要充当搬运工、司机、业务联系人、法人代表、出纳等众多角色，累死累活公司的规模也上不去，人手不够制约了公司的发展。那么怎么办，很简单，增加人手，用编程的话来说就是“再起个线程”。</font></p>
<p><font size="2"></font></p>
<p><font size="2">我们现在就用代码来描述这样的场景吧，首先，我们准备成立一家搬家公司，于是要准备好将来和客户签的合同书：</font></p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; font-size: 8pt; cursor: text;">
<div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> Contract</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   3:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">string</span> ID { get; <span style="color: rgb(0, 0, 255);">private</span> set; }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   4:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">string</span> From { get; set; }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   5:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">string</span> To { get; set; }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   6:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">decimal</span> Fee { get; set; }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   7:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   8:</span>     <span style="color: rgb(0, 0, 255);">public</span> Contract()</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   9:</span>     {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  10:</span>         <span style="color: rgb(0, 0, 255);">this</span>.ID = Guid.NewGuid().ToString()</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  11:</span>     }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  12:</span> }</pre></div></div>
<p>&nbsp;</p>
<p><font size="2">简是简单了点儿，好歹也是份合同，现在我们就去申请注册一家公司，并组建好初创团队，哪怕目前还只有老板一个人：</font></p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; font-size: 8pt; cursor: text;">
<div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> HouseMovingCompany</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   3:</span>     <span style="color: rgb(0, 0, 255);">private</span> <span style="color: rgb(0, 0, 255);">static</span> HouseMovingCompany _instance = <span style="color: rgb(0, 0, 255);">null</span>;</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   4:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">static</span> HouseMovingCompany Instance</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   5:</span>     {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   6:</span>         get { <span style="color: rgb(0, 0, 255);">return</span> (_instance == <span style="color: rgb(0, 0, 255);">null</span> ? _instance = <span style="color: rgb(0, 0, 255);">new</span> HouseMovingCompany() : _instance); }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   7:</span>     }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   8:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   9:</span>     <span style="color: rgb(0, 0, 255);">public</span> List&lt;Contract&gt; Contracts { get; <span style="color: rgb(0, 0, 255);">private</span> set; }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  10:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  11:</span>     <span style="color: rgb(0, 0, 255);">public</span> HouseMovingCompany()</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  12:</span>     {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  13:</span>         <span style="color: rgb(0, 0, 255);">this</span>.Contracts = <span style="color: rgb(0, 0, 255);">new</span> List&lt;Contract&gt;();</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  14:</span>     }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  15:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  16:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">void</span> MoveHouse()</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  17:</span>     {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  18:</span>         <span style="color: rgb(0, 0, 255);">if</span> (<span style="color: rgb(0, 0, 255);">this</span>.Contracts == <span style="color: rgb(0, 0, 255);">null</span> || <span style="color: rgb(0, 0, 255);">this</span>.Contracts.Count == 0)</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  19:</span>         {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  20:</span>             <span style="color: rgb(0, 0, 255);">return</span>;</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  21:</span>         }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  22:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  23:</span>         Contract contract = contract = <span style="color: rgb(0, 0, 255);">this</span>.Contracts[0];</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  24:</span>         <span style="color: rgb(0, 0, 255);">this</span>.Contracts.RemoveAt(0);</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  25:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  26:</span>         <span style="color: rgb(0, 0, 255);">if</span> (!String.IsNullOrEmpty(contract.From) &amp;&amp; !String.IsNullOrEmpty(contract.To))</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  27:</span>         {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  28:</span>             Console.WriteLine(<span style="color: rgb(0, 96, 128);">"Move the house from {0} to {1}."</span>, contract.From, contract.To);</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  29:</span>         }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  30:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  31:</span>         Thread.Sleep(5000);</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  32:</span>     }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  33:</span> }</pre></div></div>
<p><font size="2">好了，现在公司实体有了，老板就可以开始忙活了：</font></p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;">
<div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">static</span> <span style="color: rgb(0, 0, 255);">void</span> Main(<span style="color: rgb(0, 0, 255);">string</span>[] args)</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   3:</span>     HouseMovingCompany.Instance.Contracts.Add(<span style="color: rgb(0, 0, 255);">new</span> Contract { From = <span style="color: rgb(0, 96, 128);">"WuDaokou"</span>, To = <span style="color: rgb(0, 96, 128);">"LinDa Road"</span>, Fee = 500 });</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   4:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   5:</span>     <span style="color: rgb(0, 0, 255);">while</span> (HouseMovingCompany.Instance.Contracts.Count &gt; 0)</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   6:</span>     {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   7:</span>         HouseMovingCompany.Instance.MoveHouse();</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   8:</span>     }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   9:</span> }</pre></div></div>
<p><font size="2">我们在前面设置了每次搬家耗时5秒钟，咱们把它想象成5个小时。嗯，一天接一个单子，还可以接受，但是随着老板生意日渐兴隆，有时候一天要接3个单子，这就最少要工作15个小时了，还要操心公司的运营等问题，的确忙不过来了，而且照这样算，老板一天不可能完成5个或5个以上的单子，严重制约了公司的发展：</font></p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; font-size: 8pt; cursor: text;">
<div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">static</span> <span style="color: rgb(0, 0, 255);">void</span> Main(<span style="color: rgb(0, 0, 255);">string</span>[] args)</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   3:</span>     HouseMovingCompany.Instance.Contracts.Add(<span style="color: rgb(0, 0, 255);">new</span> Contract { From = <span style="color: rgb(0, 96, 128);">"WuDaokou"</span>, To = <span style="color: rgb(0, 96, 128);">"LinDa Road"</span>, Fee = 500 });</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   4:</span>     HouseMovingCompany.Instance.Contracts.Add(<span style="color: rgb(0, 0, 255);">new</span> Contract { From = <span style="color: rgb(0, 96, 128);">"XiDan"</span>, To = <span style="color: rgb(0, 96, 128);">"WangFujing"</span>, Fee = 1000 });</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   5:</span>     HouseMovingCompany.Instance.Contracts.Add(<span style="color: rgb(0, 0, 255);">new</span> Contract { From = <span style="color: rgb(0, 96, 128);">"XiangShan"</span>, To = <span style="color: rgb(0, 96, 128);">"The Forbidden City"</span>, Fee = 10000 });</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   6:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   7:</span>     <span style="color: rgb(0, 0, 255);">while</span> (HouseMovingCompany.Instance.Contracts.Count &gt; 0)</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   8:</span>     {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   9:</span>         HouseMovingCompany.Instance.MoveHouse();</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  10:</span>     }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  11:</span> }</pre></div></div>
<p><font size="2">一天夜里，老板拖着疲倦的身子回到家里，一进门就一头倒在床上，他极力睁着快睁不开的眼睛，努力地对自己说：“不行，我一定要想个办法，不然我会被累死的！”。</font></p>
<p><font size="2">其实办法很简单，谁都知道，招聘几个员工，再买几辆车，大家分头行动，不仅分担了工作负担，而且在规模扩大的同时还可以完成更多更大的单子。好，我们现在就借助多线程机制来实现我们的想法：</font></p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; font-size: 8pt; cursor: text;">
<div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">static</span> <span style="color: rgb(0, 0, 255);">void</span> Main(<span style="color: rgb(0, 0, 255);">string</span>[] args)</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   3:</span>     HouseMovingCompany.Instance.Contracts.Add(<span style="color: rgb(0, 0, 255);">new</span> Contract { From = <span style="color: rgb(0, 96, 128);">"WuDaokou"</span>, To = <span style="color: rgb(0, 96, 128);">"LinDa Road"</span>, Fee = 500 });</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   4:</span>     HouseMovingCompany.Instance.Contracts.Add(<span style="color: rgb(0, 0, 255);">new</span> Contract { From = <span style="color: rgb(0, 96, 128);">"XiDan"</span>, To = <span style="color: rgb(0, 96, 128);">"WangFujing"</span>, Fee = 1000 });</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   5:</span>     HouseMovingCompany.Instance.Contracts.Add(<span style="color: rgb(0, 0, 255);">new</span> Contract { From = <span style="color: rgb(0, 96, 128);">"XiangShan"</span>, To = <span style="color: rgb(0, 96, 128);">"The Forbidden City"</span>, Fee = 10000 });</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   6:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   7:</span>     Thread thread = <span style="color: rgb(0, 0, 255);">null</span>;</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   8:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   9:</span>     <span style="color: rgb(0, 0, 255);">while</span> (HouseMovingCompany.Instance.Contracts.Count &gt; 0)</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  10:</span>     {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  11:</span>         thread = <span style="color: rgb(0, 0, 255);">new</span> Thread(<span style="color: rgb(0, 0, 255);">new</span> ThreadStart(HouseMovingCompany.Instance.MoveHouse));</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  12:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  13:</span>         thread.Start();</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  14:</span>     }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  15:</span> }</pre></div></div>
<p><font size="2">在这段程序中，我们分头行动，让每项搬家任务都由一个小团队去完成，结果我们发现，现在做三个单子的时间跟做一个单子的时间是一样的，提高了效率也扩大了公司规模。但是，既然引入了新的工作机制，我们在公司内部也不得不做一些小小的调整：</font></p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; font-size: 8pt; cursor: text;">
<div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">void</span> MoveHouse()</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   3:</span>     <span style="color: rgb(0, 0, 255);">if</span> (<span style="color: rgb(0, 0, 255);">this</span>.Contracts == <span style="color: rgb(0, 0, 255);">null</span> || <span style="color: rgb(0, 0, 255);">this</span>.Contracts.Count == 0)</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   4:</span>     {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   5:</span>         <span style="color: rgb(0, 0, 255);">return</span>;</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   6:</span>     }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   7:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   8:</span>     Contract contract = <span style="color: rgb(0, 0, 255);">null</span>;</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">   9:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  10:</span>     <span style="color: rgb(0, 0, 255);">lock</span> (<span style="color: rgb(0, 0, 255);">this</span>.Contracts)</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  11:</span>     {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  12:</span>         contract = <span style="color: rgb(0, 0, 255);">this</span>.Contracts[0];</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  13:</span>         <span style="color: rgb(0, 0, 255);">this</span>.Contracts.RemoveAt(0);</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  14:</span>     }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  15:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  16:</span>     <span style="color: rgb(0, 0, 255);">if</span> (!String.IsNullOrEmpty(contract.From) &amp;&amp; !String.IsNullOrEmpty(contract.To))</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  17:</span>     {</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  18:</span>         Console.WriteLine(<span style="color: rgb(0, 96, 128);">"Move the house from {0} to {1}."</span>, contract.From, contract.To);</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  19:</span>     }</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  20:</span>&nbsp; </pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  21:</span>     Thread.Sleep(5000);</pre><pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: rgb(96, 96, 96);">  22:</span> }</pre></div></div>
<p><font size="2">调整的只是MoveHouse这个方法内部的一些实现细节。公司接到的单子都保存在Contracts中，所以搬家的时候需要去拿一个单子然后根据单子上的信息来工作。原先我们只有一个线程在操作Contracts，倒也不觉得什么，现在有多个线程都在对Contracts中的元素进行存取，我们不得不提防一些意外发生。这就是在使用多线程的时候常常需要考虑的并发问题，所以我们用了lock关键字，当一个线程要操作Contracts时，它先把Contracts锁起来，其实就是声明一下：“现在我在操作它，你们谁都不要动，等我弄完了再说。”在lock块结束时被锁定的对象才会被解锁，其它的线程现在才可以去操作它。</font></p>
<p><font size="2">有了多线程机制，你会发现程序可以在更短的时间内完成更多的事情。本文没有将多线程机制中的所有概念面面俱到地列举出来，但是已经向你展示了该如何使用多线程以及什么时候可以考虑使用多线程，其它的一些细节有待你去进一步探索，例如，你可以设置线程的优先级（假设逻辑上跟Fee挂钩，类似于‘加急’）等等。</font></p>
<p><font size="2">掌握多线程机制，并让它使你的应用程序变得更加强悍吧。</font></p>
<p><img style="border-width: 0px;" title="House Moving Company" alt="House Moving Company" src="housemovingcompany_6.jpg" border="0" height="386" width="570"></p>
<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(1225684,28598,1)"> 
		<span class="diggnum" id="digg_count_1225684">0</span>
	</div>
	<div class="buryit" onclick="DiggIt(1225684,28598,2)"> 
		<span class="burynum" id="bury_count_1225684">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_1225684">0</span>	
	<div class="diggword" id="digg_word_1225684">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a href="http://www.cnblogs.com/Autumoon/archive/2008/06/16/1223257.html">« </a> 上一篇：<a href="http://www.cnblogs.com/Autumoon/archive/2008/06/16/1223257.html" title="发布于2008-06-16 18:08">泛型</a><br>
<a href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1226191.html">» </a> 下一篇：<a href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1226191.html" title="发布于2008-06-19 21:10">指掌风云 秀玩美</a><br>
</div>








		</div>
		<div class="postDesc">posted @ 2008-06-19 11:18 <a href="http://www.cnblogs.com/Autumoon/">Autumoon</a> 阅读(5900) <a href="#commentform">评论(35)</a> &nbsp;<a href="http://www.cnblogs.com/Autumoon/admin/EditPosts.aspx?postid=1225684">编辑</a> <a href="http://www.cnblogs.com/Autumoon/AddToFavorite.aspx?id=1225684">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  所属分类: <a href="http://www.cnblogs.com/Autumoon/category/131874.html">白话C#系列</a></div>
	</div>
	<img src="1225684.html" height="1" width="1">
	
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html"
dc:identifier="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/Autumoon/services/trackbacks/1225684.aspx" />
</rdf:RDF>
-->

</div><!--end: topics 文章、评论容器-->
<a name="pagedcomment"></a>
<!--done-->
<br>
<div class="feedback_area_title">发表评论</div>
<div class="feedbackNoItems"><span id="span_comment_maxid" style="display: none;">1709276</span></div>
	

		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("王德水",1230130,"q5ZPRc739TW+tfyO5G/3uqkvGj5ZI/pVGE17K87qQ2q/JZLwYBy5yQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230130,"q5ZPRc739TW+tfyO5G/3uqkvGj5ZI/pVGE17K87qQ2q/JZLwYBy5yQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e7%8e%8b%e5%be%b7%e6%b0%b4" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230130">#1楼</a><a name="1230130" id="comment_anchor_1230130"></a>2008-06-19 11:23 | <a id="Comments1_CommentList_ctl00_NameLink" href="http://www.cnblogs.com/cnblogsfans/" target="_top">王德水</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e7%8e%8b%e5%be%b7%e6%b0%b4" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230130" class="blog_comment_body">正在看多线程想查点资料，直接在首页看到，支持</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("U2U",1230142,"NwS8YqKECjkuvqUw00YBTa8O+s5dfd5duE0NhFpqJFRXtqE4eVx/yg==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230142,"NwS8YqKECjkuvqUw00YBTa8O+s5dfd5duE0NhFpqJFRXtqE4eVx/yg==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=U2U" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230142">#2楼</a><a name="1230142" id="comment_anchor_1230142"></a>2008-06-19 11:33 | <a id="Comments1_CommentList_ctl01_NameLink" href="http://www.cnblogs.com/U2USoft/" target="_top">U2U</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/U2U" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230142" class="blog_comment_body">这样还不是特别深，深入到内核级的调度机制才叫好玩呢 :-D</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Ivan-Yan",1230219,"qoeOtInCyJG5g5p38m7phQkP7riAd9vEoeKG41zyLBPZkN/g2f9tzA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230219,"qoeOtInCyJG5g5p38m7phQkP7riAd9vEoeKG41zyLBPZkN/g2f9tzA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Ivan-Yan" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230219">#3楼</a><a name="1230219" id="comment_anchor_1230219"></a>2008-06-19 12:27 | <a id="Comments1_CommentList_ctl02_NameLink" href="http://www.cnblogs.com/Ivan-Yan/" target="_top">Ivan-Yan</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Ivan-Yan" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230219" class="blog_comment_body">讲的不错~</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("None9999999",1230229,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230229,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230229">#4楼</a><a name="1230229" id="comment_anchor_1230229"></a> 218.82.169.* 2008-06-19 12:40 | <a id="Comments1_CommentList_ctl03_NameLink" target="_blank">None9999999[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230229" class="blog_comment_body"> 期待下文。。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("winzheng",1230239,"f9dLJgOdG42WloBzFY86IuWL9UV9tld5RW597jo1Ut5ReQkzIeIU7A==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230239,"f9dLJgOdG42WloBzFY86IuWL9UV9tld5RW597jo1Ut5ReQkzIeIU7A==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=winzheng" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230239">#5楼</a><a name="1230239" id="comment_anchor_1230239"></a>2008-06-19 12:49 | <a id="Comments1_CommentList_ctl04_NameLink" href="http://www.cnblogs.com/winzheng/" target="_top">winzheng</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/winzheng" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230239" class="blog_comment_body">这种风格挺好，支持</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("一卡多号",1230332,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230332,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230332">#6楼</a><a name="1230332" id="comment_anchor_1230332"></a> 121.207.46.* 2008-06-19 14:09 | <a id="Comments1_CommentList_ctl05_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://www.simtool.net" target="_top">一卡多号[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230332" class="blog_comment_body">好文章！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("无锋不起浪",1230336,"gC4SGgc4AFWdoDZurLAx7r2TOTc1saOmsJhepF0PiQJdLITy1ePqPg==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230336,"gC4SGgc4AFWdoDZurLAx7r2TOTc1saOmsJhepF0PiQJdLITy1ePqPg==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%97%a0%e9%94%8b%e4%b8%8d%e8%b5%b7%e6%b5%aa" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230336">#7楼</a><a name="1230336" id="comment_anchor_1230336"></a>2008-06-19 14:11 | <a id="Comments1_CommentList_ctl06_NameLink" href="http://www.cnblogs.com/wf225/" target="_top">无锋不起浪</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%97%a0%e9%94%8b%e4%b8%8d%e8%b5%b7%e6%b5%aa" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230336" class="blog_comment_body">学习了</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("夕颜子",1230390,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230390,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230390">#8楼</a><a name="1230390" id="comment_anchor_1230390"></a> 221.215.104.* 2008-06-19 14:52 | <a id="Comments1_CommentList_ctl07_NameLink" target="_blank">夕颜子[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230390" class="blog_comment_body">最后这个图片 配套的很好</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("zdjray",1230392,"FHeBUGMqCCrPuhRBz83TRT2fetn5ngYQzaPBYI/BDfOrI7CIisZLjA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230392,"FHeBUGMqCCrPuhRBz83TRT2fetn5ngYQzaPBYI/BDfOrI7CIisZLjA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=zdjray" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230392">#9楼</a><a name="1230392" id="comment_anchor_1230392"></a>2008-06-19 14:55 | <a id="Comments1_CommentList_ctl08_NameLink" href="http://www.cnblogs.com/zdjray/" target="_top">zdjray</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/zdjray" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230392" class="blog_comment_body">支持，期待下一篇</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("bidaas",1230407,"fH3BnP0jj0XcVyDdKdRUoc02+sR08hTrf2BoLdoTlSJxAx16mcRNBA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230407,"fH3BnP0jj0XcVyDdKdRUoc02+sR08hTrf2BoLdoTlSJxAx16mcRNBA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=bidaas" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230407">#10楼</a><a name="1230407" id="comment_anchor_1230407"></a>2008-06-19 15:04 | <a id="Comments1_CommentList_ctl09_NameLink" href="http://www.cnblogs.com/bidaas2002/" target="_top">bidaas</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/bidaas" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230407" class="blog_comment_body">@U2U
<br>要都谈内核了，那你学线程编程是怎么学的？坐火箭还是开飞机？这样的文章阅读起来很轻松，也让人容易入门。
<br>楼主的风格不错，期待下文。。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Tony Zhou",1230624,"Wd4/4gVVGi4xQiCjd3EaDbEIG2OTF9VrKhle0xrtYI7VXMr/d5gNFg==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230624,"Wd4/4gVVGi4xQiCjd3EaDbEIG2OTF9VrKhle0xrtYI7VXMr/d5gNFg==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Tony+Zhou" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230624">#11楼</a><a name="1230624" id="comment_anchor_1230624"></a>2008-06-19 17:34 | <a id="Comments1_CommentList_ctl10_NameLink" href="http://www.cnblogs.com/beyondjay/" target="_top">Tony Zhou</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Tony+Zhou" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230624" class="blog_comment_body">excellent</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("fuadam",1230666,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230666,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230666">#12楼</a><a name="1230666" id="comment_anchor_1230666"></a> 61.181.207.* 2008-06-19 18:37 | <a id="Comments1_CommentList_ctl11_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://blog.csdn.net/fuadam/" target="_top">fuadam[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230666" class="blog_comment_body">希望能讲一下多线程中的模型，比如生产消费者，还有哲学家问题什么的</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("皇帝的新装",1230683,"bmwrPCU5gvgJ7M/fEMkZNEKz76zaJ3q+lAXcbVHIzK0PSMtWAclAuw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230683,"bmwrPCU5gvgJ7M/fEMkZNEKz76zaJ3q+lAXcbVHIzK0PSMtWAclAuw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e7%9a%87%e5%b8%9d%e7%9a%84%e6%96%b0%e8%a3%85" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230683">#13楼</a><a name="1230683" id="comment_anchor_1230683"></a>2008-06-19 19:08 | <a id="Comments1_CommentList_ctl12_NameLink" href="http://www.cnblogs.com/yanrongpi/" target="_top">皇帝的新装</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e7%9a%87%e5%b8%9d%e7%9a%84%e6%96%b0%e8%a3%85" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230683" class="blog_comment_body">好。这个问题很难讲清楚。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("DQW",1230745,"v0cdVWZ2doP/eqDqZAgGLqUg97BPQnbjvN+q/Gj6fFng88dE/PLkpQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230745,"v0cdVWZ2doP/eqDqZAgGLqUg97BPQnbjvN+q/Gj6fFng88dE/PLkpQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=DQW" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230745">#14楼</a><a name="1230745" id="comment_anchor_1230745"></a>2008-06-19 20:57 | <a id="Comments1_CommentList_ctl13_NameLink" href="http://www.cnblogs.com/dqw3721/" target="_top">DQW</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/DQW" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230745" class="blog_comment_body">学习了</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Jacky Chyi",1230773,"IDQvjGvgQ5/3eNUk5hAef37LxcIsSew5RS+5v+2Uig+X+nT/chijfA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1230773,"IDQvjGvgQ5/3eNUk5hAef37LxcIsSew5RS+5v+2Uig+X+nT/chijfA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Jacky+Chyi" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1230773">#15楼</a><a name="1230773" id="comment_anchor_1230773"></a>2008-06-19 21:44 | <a id="Comments1_CommentList_ctl14_NameLink" href="http://www.cnblogs.com/chyi/" target="_top">Jacky Chyi</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Jacky+Chyi" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1230773" class="blog_comment_body">建议楼主给代码加点注释...虽然有简洁的语言举例子...但是没有代码的注释还是感觉少点什么...</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("江水滔滔",1231046,"xi1P5cpW4lRJcZdZdRZik6t8Wdr/xwAAODAiJzu8T+LvUh0w1KG20w==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1231046,"xi1P5cpW4lRJcZdZdRZik6t8Wdr/xwAAODAiJzu8T+LvUh0w1KG20w==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%b1%9f%e6%b0%b4%e6%bb%94%e6%bb%94" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1231046">#16楼</a><a name="1231046" id="comment_anchor_1231046"></a>2008-06-20 09:56 | <a id="Comments1_CommentList_ctl15_NameLink" href="http://www.cnblogs.com/szbaby1221/" target="_top">江水滔滔</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%b1%9f%e6%b0%b4%e6%bb%94%e6%bb%94" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1231046" class="blog_comment_body">請問如果我做的是一些列操作呢?
<br>比如包装：
<br>A: 根据 机身条码 ，分配号段
<br>多线程中如和来控制事务呢？号段出错了，该如何重分配呢？
<br>多线程设计到资源锁，效率和单线程有多大的提升
<br>关键是如何控制异样？
<br>请指导！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Autumoon",1231051,"M6sed0jREdUJvqEIDK6Tcwj6B9iFJq2qtJqYsoSPdqAKnXcYRqIo3A==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1231051,"M6sed0jREdUJvqEIDK6Tcwj6B9iFJq2qtJqYsoSPdqAKnXcYRqIo3A==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Autumoon" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1231051">#17楼</a><a name="1231051" id="comment_anchor_1231051"></a>[<span class="louzhu">楼主</span>]2008-06-20 10:01 | <a id="Comments1_CommentList_ctl16_NameLink" href="http://www.cnblogs.com/Autumoon/" target="_top">Autumoon</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Autumoon" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1231051" class="blog_comment_body">@江水滔滔
<br>
<br>这要根据项目的具体需求去设计了，不是一两句话能讲清楚的。请先熟悉了多线程的使用之后再结合具体需求去设计吧，祝工作愉快！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("江水滔滔",1231069,"xi1P5cpW4lRJcZdZdRZik6t8Wdr/xwAAODAiJzu8T+LvUh0w1KG20w==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1231069,"xi1P5cpW4lRJcZdZdRZik6t8Wdr/xwAAODAiJzu8T+LvUh0w1KG20w==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%b1%9f%e6%b0%b4%e6%bb%94%e6%bb%94" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1231069">#18楼</a><a name="1231069" id="comment_anchor_1231069"></a>2008-06-20 10:15 | <a id="Comments1_CommentList_ctl17_NameLink" href="http://www.cnblogs.com/szbaby1221/" target="_top">江水滔滔</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%b1%9f%e6%b0%b4%e6%bb%94%e6%bb%94" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1231069" class="blog_comment_body">在一般情况下，我做了测试，有的时候涉及到锁，lock 住了，其实效率也并不是那么高，可能还和CPU有关系吧。
<br>还有就是少数量的时候效率也不是那么高！
<br>
<br>就比如：人多了就难管理是不是呢？我以前也做过多线程，到现在还是一知半解！
<br>
<br>我用了你的列子做了测试，发现本机的效率还不如单的快，10000条记录
<br>
<br>
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("haozi",1231423,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1231423,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1231423">#19楼</a><a name="1231423" id="comment_anchor_1231423"></a> 192.58.248.* 2008-06-20 15:17 | <a id="Comments1_CommentList_ctl18_NameLink" target="_blank">haozi[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1231423" class="blog_comment_body">讲的生动活泼，不错</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("lusens",1231547,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1231547,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1231547">#20楼</a><a name="1231547" id="comment_anchor_1231547"></a> 211.148.134.* 2008-06-20 16:56 | <a id="Comments1_CommentList_ctl19_NameLink" target="_blank">lusens[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1231547" class="blog_comment_body">楼主讲得很形象</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("张波sun",1232325,"qnOV+bdK51aYwPJthP1TTiGuHrjazS+Ysg9h7h82ENqXSM8DtM6rmA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1232325,"qnOV+bdK51aYwPJthP1TTiGuHrjazS+Ysg9h7h82ENqXSM8DtM6rmA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e5%bc%a0%e6%b3%a2sun" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1232325">#21楼</a><a name="1232325" id="comment_anchor_1232325"></a>2008-06-21 21:42 | <a id="Comments1_CommentList_ctl20_NameLink" href="http://www.cnblogs.com/zhangbosun/" target="_top">张波sun</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e5%bc%a0%e6%b3%a2sun" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1232325" class="blog_comment_body">学习</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("kenzo",1240858,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1240858,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1240858">#22楼</a><a name="1240858" id="comment_anchor_1240858"></a> 116.24.75.* 2008-07-01 10:55 | <a id="Comments1_CommentList_ctl21_NameLink" target="_blank">kenzo[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1240858" class="blog_comment_body">很好用啊。谢谢！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("KymoWang",1241230,"Cq8e47EbUbo+iLTozeVGArInI4JE/SwUY/v0o8A8mp3NqCEFjim+3A==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1241230,"Cq8e47EbUbo+iLTozeVGArInI4JE/SwUY/v0o8A8mp3NqCEFjim+3A==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=KymoWang" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1241230">#23楼</a><a name="1241230" id="comment_anchor_1241230"></a>2008-07-01 15:33 | <a id="Comments1_CommentList_ctl22_NameLink" href="http://www.cnblogs.com/Kymo/" target="_top">KymoWang</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/KymoWang" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1241230" class="blog_comment_body">你是不是为了快速测试，把Thread.Sleep去掉了？CPU只有一个，只有给CPU空闲才能发挥多线程的优势（猜的^o^）
<br>--引用--------------------------------------------------
<br>江水滔滔: 在一般情况下，我做了测试，有的时候涉及到锁，lock 住了，其实效率也并不是那么高，可能还和CPU有关系吧。
<br>还有就是少数量的时候效率也不是那么高！
<br>
<br>就比如：人多了就难管理是不是呢？我以前也做过多线程，到现在还是一知半解！
<br>
<br>我用了你的列子做了测试，发现本机的效率还不如单的快，10000条记录
<br>
<br>
<br>
<br>--------------------------------------------------------
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("oscarzq",1285724,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1285724,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1285724">#24楼</a><a name="1285724" id="comment_anchor_1285724"></a> 58.211.166.* 2008-08-13 19:53 | <a id="Comments1_CommentList_ctl23_NameLink" target="_blank">oscarzq[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1285724" class="blog_comment_body">楼主对线程很精通，请教个问题，我想用线程调用一个未知（参数和返回类型不确定）的方法，怎么调用阿？谢谢解答。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Eric zhou",1290878,"BeNbaIH3KiPMJbfGF0O9lhUO66Ji2ZiZc6P2CFrw069p+u1xxqi8NA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1290878,"BeNbaIH3KiPMJbfGF0O9lhUO66Ji2ZiZc6P2CFrw069p+u1xxqi8NA==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Eric+zhou" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1290878">#25楼</a><a name="1290878" id="comment_anchor_1290878"></a>2008-08-19 08:54 | <a id="Comments1_CommentList_ctl24_NameLink" href="http://www.cnblogs.com/tianqing/" target="_top">Eric zhou</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Eric+zhou" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1290878" class="blog_comment_body">支持</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("梦涯",1341707,"1564OuyX7yKjXyU3liiE4rzHf1F9IOPXT3gOQ6AxBfCG0rR8t0yK0Q==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1341707,"1564OuyX7yKjXyU3liiE4rzHf1F9IOPXT3gOQ6AxBfCG0rR8t0yK0Q==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%a2%a6%e6%b6%af" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1341707">#26楼</a><a name="1341707" id="comment_anchor_1341707"></a>2008-10-15 18:15 | <a id="Comments1_CommentList_ctl25_NameLink" href="http://www.cnblogs.com/5197668/" target="_top">梦涯</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%a2%a6%e6%b6%af" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1341707" class="blog_comment_body">@oscarzq
<br>我觉得应该用反射</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("梦涯",1341713,"1564OuyX7yKjXyU3liiE4rzHf1F9IOPXT3gOQ6AxBfCG0rR8t0yK0Q==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1341713,"1564OuyX7yKjXyU3liiE4rzHf1F9IOPXT3gOQ6AxBfCG0rR8t0yK0Q==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%a2%a6%e6%b6%af" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1341713">#27楼</a><a name="1341713" id="comment_anchor_1341713"></a>2008-10-15 18:21 | <a id="Comments1_CommentList_ctl26_NameLink" href="http://www.cnblogs.com/5197668/" target="_top">梦涯</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%a2%a6%e6%b6%af" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1341713" class="blog_comment_body">但是我觉得楼主本意是想加深我们对线程的理解，可是我觉得用这个列子有点不太妥当，首先多线程机制在实际中并不能达到象三个线程同时运行就能省下两个线程的时间，因为毕竟CPU只有一个，并不能说有三个CPU同时运行，所以多线程只能说计算时间片让这些线程轮流运行，不能达到搬家公司3个人同时搬的效果~呵呵 刚接触程序 一点拙见~~</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("591624310@qq.com",1439661,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1439661,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1439661">#28楼</a><a name="1439661" id="comment_anchor_1439661"></a> 117.44.47.* 2009-01-30 23:28 | <a id="Comments1_CommentList_ctl27_NameLink" target="_blank">591624310@qq.com[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1439661" class="blog_comment_body">什么程序不是靠时间片运行的?开两个QQ你说是同时运行,这和开两个线程有什么不同?只不过一个是进程一个是线程而已
<br>楼上的在说废话,鉴定完毕!
<br>另外,我就恶心线程中的代码不能调试么?每次都是编译器卡一下然后程序就中断了,希望博主能解惑</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("NeoChina",1556671,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1556671,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1556671">#29楼</a><a name="1556671" id="comment_anchor_1556671"></a> 221.222.246.* 2009-06-13 15:52 | <a id="Comments1_CommentList_ctl28_NameLink" href="http://space.cnblogs.com/69314/" target="_top">NeoChina</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1556671" class="blog_comment_body">浅显易懂
<br>很好的文章
<br>楼主辛苦了</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("reyzhang",1571646,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1571646,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1571646">#30楼</a><a name="1571646" id="comment_anchor_1571646"></a> 60.209.248.* 2009-06-30 13:41 | <a id="Comments1_CommentList_ctl29_NameLink" target="_blank">reyzhang[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1571646" class="blog_comment_body">浅显易懂,再讲的深入一点会更好</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("reyzhang",1572525,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1572525,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1572525">#31楼</a><a name="1572525" id="comment_anchor_1572525"></a> 60.209.248.* 2009-07-01 13:27 | <a id="Comments1_CommentList_ctl30_NameLink" target="_blank">reyzhang[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1572525" class="blog_comment_body">while (HouseMovingCompany.Instance.Contracts.Count &gt; 0)  
<br>{  
<br>        thread = new Thread(new ThreadStart(HouseMovingCompany.Instance.MoveHouse));  
<br>        thread.Start();  
<br>
<br> }
<br>
<br>这貌似是个死循环</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("gumarco",1587848,"HbQHS8BHpETCWjspGJ0ZZUqYyVYkxiRy2JcBkkx1+ECIhSvWLYHffQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1587848,"HbQHS8BHpETCWjspGJ0ZZUqYyVYkxiRy2JcBkkx1+ECIhSvWLYHffQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=gumarco" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1587848">#32楼</a><a name="1587848" id="comment_anchor_1587848"></a>2009-07-17 17:16 | <a id="Comments1_CommentList_ctl31_NameLink" href="http://www.cnblogs.com/gumarco/" target="_top">gumarco</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/gumarco" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1587848" class="blog_comment_body"><fieldset class="comment_quote"><legend><a href="#1572525" title="查看引用原文">引用</a></legend>reyzhang：while (HouseMovingCompany.Instance.Contracts.Count &gt; 0)  <br>&lt;br/&gt;{  <br>&lt;br/&gt;        thread = new Thread(new ThreadStart(HouseMovingCompany.Instance.MoveHouse));  <br>&lt;br/&gt;        thread.Start();  <br>&lt;br/&gt;<br>&lt;br/&gt; }<br>&lt;br/&gt;<br>&lt;br/&gt;这貌似是个死循环</fieldset><br>你没有看懂 <br>this.Contracts.RemoveAt(0);<br>干吗用的？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("邀月",1640563,"N9voHu7/XmVHEMiEBmKUybfkqwCcIfTF25dLsaqov25wUoHoco3Agg==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1640563,"N9voHu7/XmVHEMiEBmKUybfkqwCcIfTF25dLsaqov25wUoHoco3Agg==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e9%82%80%e6%9c%88" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1640563">#33楼</a><a name="1640563" id="comment_anchor_1640563"></a>2009-09-08 23:14 | <a id="Comments1_CommentList_ctl32_NameLink" href="http://www.cnblogs.com/downmoon/" target="_top">邀月</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e9%82%80%e6%9c%88" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1640563" class="blog_comment_body">生动·</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("liangwei389",1647188,"SKJmpXgZsZjp0ZBPfnZb0Qmg5EbJIs9OryNfyVAePEfbiXNmEJOPpQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1647188,"SKJmpXgZsZjp0ZBPfnZb0Qmg5EbJIs9OryNfyVAePEfbiXNmEJOPpQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=liangwei389" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1647188">#34楼</a><a name="1647188" id="comment_anchor_1647188"></a>2009-09-15 15:05 | <a id="Comments1_CommentList_ctl33_NameLink" href="http://www.cnblogs.com/liangwei389/" target="_top">liangwei389</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/liangwei389" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1647188" class="blog_comment_body">写得很精彩,学习了,谢谢博主,期待下文!</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("初识线程",1709276,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1709276,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1709276">#36楼</a><a name="1709276" id="comment_anchor_1709276"></a> 211.143.30.* <a name="Post"></a>2009-11-28 10:35 | <a id="Comments1_CommentList_ctl34_NameLink" target="_blank">初识线程[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1709276" class="blog_comment_body">  是不是线程就是想说。<br>在一定时间段内。<br>   制定一系列的方法。<br>     然后根据线程优先级的控制。<br>  让系统自动开始 释放 再执行下个方法的概念！！ <br>   所谓的加快速度。是不是就是指。所有的方法不再需要我们自己手动执行。而是通过线程能够即时执行那一系列的方法，而省去手动执行的时间空余！<br>   一点拙见 和 自己的理解。 希望大家能解惑哈！！！！</span><br>
			</div>
		</div>
	

<div id="comment_form" class="commentform">



<div id="divCommentShow"></div>
<div id="comment_nav" style="text-align: right;"><span id="span_refresh_tips"></span><a href="###" onclick="return RefreshCommentList(1225684);" name="commentform" id="lnk_RefreshComments">刷新评论列表</a>&nbsp; <a href="###" onclick="return RefreshPage();">刷新页面</a>&nbsp; <a href="#top">返回页首</a></div>
<div id="commentform_title">发表评论 <span class="ad_commentbox_up"><a href="http://www.cnblogs.com/" target="_top">博客园首页</a>&nbsp; <a href="http://news.cnblogs.com/" target="_top">IT新闻</a>&nbsp; <a href="http://home.cnblogs.com/ing/" target="_top">闪存</a>&nbsp; <a href="http://job.cnblogs.com/" target="_top">招聘</a>&nbsp; <a href="http://a4.yeshj.com/rd/34143/" target="_top">学英语</a></span></div>
<span id="tip_comment" style="color: Red;"></span>
<p>
昵称：<input name="ctl05$tbCommentAuthor" id="ctl05_tbCommentAuthor" class="author" value="解然" disabled="disabled" type="text">
</p>
<p>
主页：<input name="ctl05$tbCommentAuthorUrl" id="ctl05_tbCommentAuthorUrl" class="url" value="http://www.cnblogs.com/xieran/" disabled="disabled" type="text">
</p>
<p>
</p><div class="commentbox_title">
<div class="commentbox_title_left">评论内容：</div>
<div class="commentbox_title_right">
<img id="ubb_quote" class="comment_icon" src="quote.gif" alt="引用" title="添加引用" onclick="insertUBB('tbCommentBody','quote')">
<img id="ubb_bold" class="comment_icon" src="b.png" alt="粗体" title="添加粗体" onclick="insertUBB('tbCommentBody','b')">
<img id="ubb_url" class="comment_icon" src="lk.png" alt="链接" title="添加链接" onclick="insertUbbUrl('tbCommentBody')">
<img id="ubb_indent" class="comment_icon" src="indent.png" alt="缩进" title="添加首行缩进" onclick="insertIndent('tbCommentBody')">
<img id="ubb_img" class="comment_icon" src="img.gif" alt="图片" title="添加图片" onclick="insertUbbImg('tbCommentBody')">
<img id="ubb_code" class="comment_icon" style="" src="insertcode.gif" alt="代码" title="添加代码" onclick="insertUbbCode()">
</div>
</div>
<div class="clear"></div>
<textarea id="tbCommentBody" class="comment_textarea" onkeydown="return clt_enter(event)"></textarea>

<p>
<input id="btn_comment_submit" class="comment_btn" value="提交" onclick="PostComment();return false;" type="button">
&nbsp;&nbsp;<span id="span_comment_canceledit" style="display: none;"><a href="###" onclick="return CancelCommentEdit()">不改了</a>&nbsp;&nbsp;</span><a href="http://passport.cnblogs.com/logout.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2fAutumoon%2farchive%2f2008%2f06%2f19%2f1225684.html%3flogout%3d1%23commentform" onclick="return confirm('确认注销吗？')">注销</a>&nbsp;&nbsp;<a id="ctl05_lnkSubscribe" title="邮件订阅回复通知" onclick="return SubscribeComment();" href="http://www.cnblogs.com/UI/Controls/#%23%23">订阅回复</a>
</p>
<p>
[使用Ctrl+Enter键快速提交]
</p>
<div style="display: none;">
<span id="comment_edit_id"></span><span id="span_parentcomment_id">0</span>
<span id="span_parent_id">1225684</span>
<span id="span_comment_replyto"></span>
<span id="span_comment_title">多线程</span>
<span id="span_comment_posted"></span>
</div>

<div class="itnews c_ad_block" id="itnews">
<a href="http://news.cnblogs.com/" target="_top">IT新闻</a>:<br>

          ·  <a href="http://news.cnblogs.com/n/55140/" target="_top">《星际争霸2》"刀锋女王"重金属主题音乐视频</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55139/" target="_top">中国站长最郁闷的几件事情</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55138/" target="_top">苹果Vs谷歌：手机领域谁怕谁？</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55137/" target="_top">摩托罗拉：豪赌Android的希望与隐忧</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55136/" target="_top">分众新坐标：楼宇是过去 未来在手机和互联网</a><br>
	
</div>


<div id="ad_under_comment" class="c_ad_block">
<a href="http://a4.yeshj.com/rd/34138/" target="_top">每天10分钟，轻松学英语</a><br><br>
<div id="google_ads_div_cnblogs_blogpost_bottom1">
<iframe src="index_1.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom1" id="google_ads_iframe_cnblogs_blogpost_bottom1" scrolling="no" frameborder="0" height="60" width="468"></iframe></div>

<br>
<div id="google_ads_div_cnblogs_blogpost_bottom">
<iframe src="index_2.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom" id="google_ads_iframe_cnblogs_blogpost_bottom" scrolling="no" frameborder="0" height="250" width="300"></iframe></div>

</div>
<div id="site_nav_under" class="c_ad_block">
网站导航：<br>
<a href="http://www.cnblogs.com/" target="_top">博客园首页</a> &nbsp;<a href="http://news.cnblogs.com/" target="_top">IT新闻</a> &nbsp;<a href="http://home.cnblogs.com/" target="_top">个人主页</a> &nbsp;<a href="http://home.cnblogs.com/ing/" target="_top">闪存</a> &nbsp;<a href="http://job.cnblogs.com/" target="_top">程序员招聘</a> &nbsp;<a href="http://space.cnblogs.com/" target="_top">社区</a> &nbsp;<a href="http://space.cnblogs.com/q/" target="_top">博问</a> &nbsp;<a href="http://wz.cnblogs.com/" target="_top">网摘</a>
</div>
<div id="ad_under_comment2" class="c_ad_block">
<a href="http://www.china-pub.com/STATIC07/0912/zh_ndcx_091212.asp" target="_top"><img src="chinapub_20091222.jpg" alt="" style="border: 0px none ;"></a><br>
<a href="http://www.china-pub.com/itbook/" target="_top">China-pub 计算机图书网上专卖店！6.5万品种2-8折！</a><br>
<a href="http://www.china-pub.com/static07/0901/zh_jueba_090121.asp" target="_top">China-Pub 计算机绝版图书按需印刷服务</a><br>
</div>


<div id="div_commentbox_nav" class="c_ad_block">
链接：<a href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html?switchskin=1#skinlist">切换模板</a><br>
</div>
<div id="relative_search"><br><b>相关搜索:</b><br> <a href="http://zzk.cnblogs.com/s?w=%e7%99%bd%e8%af%9dC%23%e7%b3%bb%e5%88%97" target="_top">白话C#系列</a> </div><div id="relative_search"><br><b>在知识库中查看：</b><br> <a href="http://kb.cnblogs.com/a/1225684/">多线程</a></div>

</div>




				
	</div><!--end: forFlow -->
	</div><!--end: mainContent 主体内容容器-->

	<div id="sideBar">
		<div id="sideBarMain">
			
<!--done-->
<div class="newsItem">
<h3 class="catListTitle">公告</h3>
	<p align="center"><embed src="world001-blue.swf" type="application/x-shockwave-flash" wmode="transparent" height="92" width="175"><br>
<br>
Since&nbsp;May 31, 1998.<br><!--<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#88;&#105;&#110;&#119;&#101;&#110;&#67;&#104;&#101;&#110;&#103;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;"><img height=21 alt="" src="http://images.cnblogs.com/cnblogs_com/zerocool/MyGmailLink.png" width=175 border=0 /></a><br/><br/>--><img src="r_mvp.png" alt="MVP (Visual C#)"><br><br></p><div style=""><table style="" cellpadding="4" cellspacing="0"><tbody><tr align="center"><td style=""><a href="http://www.douban.com/subject/3883231/" title="Pro Silverlight 3 in C#" target="_top"><img src="s3900991.jpg" border="0"></a></td><td style=""><a href="http://www.douban.com/subject/1136852/" title="南怀瑾选集（第三卷）" target="_top"><img src="s2177899.jpg" border="0"></a></td></tr><tr align="center"><td style=""><a href="http://www.douban.com/subject/1085660/" title="尽管去做

Getting Things Done The Art of Stress-free Productivity" target="_top"><img src="s1796471.jpg" border="0"></a></td><td style=""><a href="http://www.douban.com/subject/3696561/" title="世界又热又平又挤" target="_top"><img src="s3763074.jpg" border="0"></a></td></tr><tr align="center"><td style=""><a href="http://www.douban.com/subject/1477390/" title="代码大全（第2版）" target="_top"><img src="s1495029.jpg" border="0"></a></td></tr><tr><td colspan="2" align="center"><a href="http://www.douban.com/people/XinwenCheng/" target="_top">我的豆瓣主页</a></td></tr></tbody></table></div><br><div id="profile_block"><a href="http://home.cnblogs.com/Autumoon/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/Autumoon/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/Autumoon/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/Autumoon" target="_top">发短消息</a></div>
</div>

			<div id="calendar"></div>
			
			<div id="leftcontentcontainer">
				
<div class="catListPostCategory">
<h3 class="catListTitle">随笔分类<span style="font-size: 11px; font-weight: normal;">(69)</span></h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.cnblogs.com/Autumoon/category/151002.html">.NET程序员技术面试迷你手册（C#版）(5)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to .NET程序员技术面试迷你手册（C#版）(5)" href="http://www.cnblogs.com/Autumoon/category/151002.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.cnblogs.com/Autumoon/category/102693.html">Autumoon Code Library(1)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to Autumoon Code Library(1)" href="http://www.cnblogs.com/Autumoon/category/102693.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_Link" href="http://www.cnblogs.com/Autumoon/category/112473.html">C# 3.0 探索之旅(9)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to C# 3.0 探索之旅(9)" href="http://www.cnblogs.com/Autumoon/category/112473.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_Link" href="http://www.cnblogs.com/Autumoon/category/113499.html">LINQ 探索之旅(5)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to LINQ 探索之旅(5)" href="http://www.cnblogs.com/Autumoon/category/113499.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_Link" href="http://www.cnblogs.com/Autumoon/category/158314.html">Office Live for Small Business(4)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_RssLink" title="Subscribe to Office Live for Small Business(4)" href="http://www.cnblogs.com/Autumoon/category/158314.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_Link" href="http://www.cnblogs.com/Autumoon/category/131874.html">白话C#系列(8)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_RssLink" title="Subscribe to 白话C#系列(8)" href="http://www.cnblogs.com/Autumoon/category/131874.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_Link" href="http://www.cnblogs.com/Autumoon/category/221050.html">读书笔记(1)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_RssLink" title="Subscribe to 读书笔记(1)" href="http://www.cnblogs.com/Autumoon/category/221050.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_Link" href="http://www.cnblogs.com/Autumoon/category/141025.html">多普达 Touch Diamond 创新前沿体验(4)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_RssLink" title="Subscribe to 多普达 Touch Diamond 创新前沿体验(4)" href="http://www.cnblogs.com/Autumoon/category/141025.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl09_Link" href="http://www.cnblogs.com/Autumoon/category/102692.html">公告(2)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl09_RssLink" title="Subscribe to 公告(2)" href="http://www.cnblogs.com/Autumoon/category/102692.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl10_Link" href="http://www.cnblogs.com/Autumoon/category/102688.html">技术杂文(3)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl10_RssLink" title="Subscribe to 技术杂文(3)" href="http://www.cnblogs.com/Autumoon/category/102688.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl11_Link" href="http://www.cnblogs.com/Autumoon/category/114802.html">简明设计模式——C#版(25)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl11_RssLink" title="Subscribe to 简明设计模式——C#版(25)" href="http://www.cnblogs.com/Autumoon/category/114802.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl12_Link" href="http://www.cnblogs.com/Autumoon/category/228064.html">时间管理(2)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl12_RssLink" title="Subscribe to 时间管理(2)" href="http://www.cnblogs.com/Autumoon/category/228064.html/rss">(rss)</a></li>

</ul>

</div>

<div class="catList">
<h3 class="catListTitle">友情链接</h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.codeplex.com/site/users/view/Autumoon" target="_top">Autumoon @ CodePlex</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_Link" href="http://zerocool.cnblogs.com/" target="_top">作者博客</a> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_RssLink" title="Subscribe to 作者博客" href="http://www.cnblogs.com/ZeroCool/rss">(rss)</a></li>
<li style="margin-top: 2px;">/* ZeroCool的个人博客 */</li>
</ul>

</div>



<div class="catListComment">
<h3 class="catListTitle">最新评论<a id="SingleColumn1__3514896_RSSHyperlink1" title="RSS订阅最最新评论" href="http://www.cnblogs.com/Autumoon/CommentsRSS.aspx"><img title="RSS订阅最最新评论" src="xml.gif" style="border-width: 0px;"></a></h3>

	
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__3514896_CommentList_ctl00_Hyperlink2" class="listitem" href="http://www.cnblogs.com/Autumoon/archive/2008/08/18/1270558.html#1748817">1.&nbsp;Re:序</a>
			</div>
			<div class="divRecentComment">
				基础的东西很重要，往往出的Bug都是这些导致的，其实软件开发最重要的思想，单基础概念同样不可忽视。 (寒枫)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__3514896_CommentList_ctl01_Hyperlink2" class="listitem" href="http://www.cnblogs.com/Autumoon/archive/2010/01/17/1649909.html#1748760">2.&nbsp;Re:把时间管理培养成习惯</a>
			</div>
			<div class="divRecentComment">
				nice article (王德水)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__3514896_CommentList_ctl02_Hyperlink2" class="listitem" href="http://www.cnblogs.com/Autumoon/archive/2010/01/17/1649909.html#1748755">3.&nbsp;Re:把时间管理培养成习惯</a>
			</div>
			<div class="divRecentComment">
				地板，呵！道理浅显易懂，但很少人会这样进行时间管理，往往是做事前稍微考虑一下。养成好的习惯的确很重要。 (GoodGF)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__3514896_CommentList_ctl03_Hyperlink2" class="listitem" href="http://www.cnblogs.com/Autumoon/archive/2010/01/17/1649909.html#1748728">4.&nbsp;Re:把时间管理培养成习惯</a>
			</div>
			<div class="divRecentComment">
				好文章 (长河落日)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__3514896_CommentList_ctl04_Hyperlink2" class="listitem" href="http://www.cnblogs.com/Autumoon/archive/2010/01/09/1642846.html#1743368">5.&nbsp;Re:时间管理——被忽视的重要理念！</a>
			</div>
			<div class="divRecentComment">
				管理时间最有效的方法，就是建立良好的生活规律！

当我们手中握有大把的时间时，效率却不一定高；反之，在挤出的时间里，恰恰相反！
 (卡通一下)
			</div>		
		
</div>

<div class="catListView">
<h3 class="catListTitle">阅读排行榜</h3>
	
			<ul>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html">1.&nbsp;多线程(5900)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html">2.&nbsp;面向对象主要概念(3461)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/06/23/1228335.html">3.&nbsp;反射(3172)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/08/18/1270685.html">4.&nbsp;值类型和引用类型的区别(3055)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/07/01/1233476.html">5.&nbsp;Touch Diamond Remote —— 世界就在指尖(2898)</a>
			</li>
		
			</ul>
		
</div>

<div class="catListFeedback">
<h3 class="catListTitle">评论排行榜</h3>
	
			<ul>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/07/01/1233476.html">1.&nbsp;Touch Diamond Remote —— 世界就在指尖(38)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html">2.&nbsp;多线程(35)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html">3.&nbsp;面向对象主要概念(26)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/08/26/1276746.html">4.&nbsp;寻找失落的SubString(23)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/08/18/1270685.html">5.&nbsp;值类型和引用类型的区别(20)</a>
			</li>
		
			</ul>
		
</div>

				
<div id="blog_ad_google">
<h3>Google广告</h3>
<ul>
<li>

<ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 250px; position: relative; visibility: visible; width: 300px;"><ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 250px; position: relative; visibility: visible; width: 300px;"><iframe allowtransparency="true" hspace="0" id="google_ads_frame3" marginheight="0" marginwidth="0" name="google_ads_frame" src="index_3.html" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" scrolling="no" frameborder="0" height="250" width="300"></iframe></ins></ins>
</li>
</ul>
</div>
			</div>
			
		</div><!--end: sideBarMain -->
	</div><!--end: sideBar 侧边栏容器 -->
	<div class="clear"></div>
	</div><!--end: main -->
	<div class="clear"></div>
	<div id="footer">
		
<!--done-->
Copyright ©2010 Autumoon
	</div><!--end: footer -->
</div><!--end: home 自定义的最大容器 -->
    </form>
	
	
      
    
    
    
</body>
</html>
